#include "Car.h"

Car::Car(int arrival)
{
	
	 frnt=rear=NULL;
	set_arrivalTime(arrival);
}

Car::Car()
{

}

struct node
{
   int data;
   struct node *next;
};

int Car::show()
{
   struct node *ptr1=frnt;
   ptr1->data;
	  cout<<"Time is "<<ptr1->data<<endl;
	  return ptr1->data;
      ptr1=ptr1->next;
	  
}

int Car::get_arrivalTime()
{	l
	cout<<"\nEnter the next cars arrival time or enter '999' to show results: ";
	cin>>arrivalTime;
	
	while(999<arrivalTime || arrivalTime<0)
	{
		cout<<"I'm sorry but time is a NUMBER! Try again: "<<endl;
		cin>>arrivalTime;
	}
	return arrivalTime;
}

void Car::set_arrivalTime(int time)
{
struct node *ptr;
   ptr = new node;
   ptr->data=time;
   ptr->next=NULL;
   if(frnt==NULL)
      frnt=ptr;
   else
      rear->next=ptr;
   rear=ptr;

}

int Car::get_bayTime(void)
{
	return 3;
}

